package com.dona.imsidetector.bean.vo;

import com.dona.imsidetector.bean.ImsiBean;
import com.dona.imsidetector.db.entity.ListItem;
import com.dona.imsidetector.utils.DeviceUtil;
import com.dona.imsidetector.utils.IMSIUtil;

import java.util.Date;

public class ListItemVo {

    private String uuid;

    private String listid;

    private int isWhite;

    private int isp;

    private String imsiaddr;

    private String province;

    private String city;

    private Date createTime;

    public ListItemVo(){

    }

    public ListItemVo(ListItem listItem){
        uuid = listItem.getUuid();
        listid = listItem.getListId();
        isWhite = listItem.getIsWhite();
        isp = listItem.getIsp();
        imsiaddr = listItem.getImsiAddr();
        province = listItem.getProvince();
        city = listItem.getCity();
        createTime = listItem.getCreateTime();
    }


    public ListItemVo(String listid, ImsiBean imsiBean){
        uuid = DeviceUtil.getUUID();
        this.listid = listid;
        isWhite = imsiBean.getIsWhite();
        isp = IMSIUtil.checkImsiType(imsiBean.getImsiAddr());
        imsiaddr = imsiBean.getImsiAddr();
        province = imsiBean.getProvince();
        city = imsiBean.getCity();
        createTime = new Date();
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getListid() {
        return listid;
    }

    public void setListid(String listid) {
        this.listid = listid;
    }

    public int getIsWhite() {
        return isWhite;
    }

    public void setIsWhite(int isWhite) {
        this.isWhite = isWhite;
    }

    public int getIsp() {
        return isp;
    }

    public void setIsp(int isp) {
        this.isp = isp;
    }

    public String getImsiaddr() {
        return imsiaddr;
    }

    public void setImsiaddr(String imsiaddr) {
        this.imsiaddr = imsiaddr;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "ListItemVo{" +
                "uuid='" + uuid + '\'' +
                ", listid='" + listid + '\'' +
                ", isWhite=" + isWhite +
                ", isp=" + isp +
                ", imsiaddr='" + imsiaddr + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
